﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;

namespace BMproductions.Media.MediaPlayer.WMPPlus {
	public static class WMPHookShared {
		public const string HookRegKey = @"SOFTWARE\BM-productions\WMPHook\HookDlls";

		public static void RegisterHook(string name, string path) {
			var root = Registry.LocalMachine;
			using (var key = root.CreateSubKey(HookRegKey)) {
				if (key == null) return;
				WMPPlusSettings.SaveRegistryString(key, name, path);
			}
		}

		public static void UnregisterHook(string name) {
			var root = Registry.LocalMachine;
			using (var key = root.OpenSubKey(HookRegKey, true)) {
				if (key == null) return;
				key.DeleteValue(name);
			}
		}
	}
}
